import vuexRichStore from 'vuex-rich-store'
import welcome from './modules/welcome'
import door from './modules/door'
import count from './modules/count'
import todos from './modules/todos'

export default () => ({
  modules: {
    door: vuexRichStore(door),
    welcome: vuexRichStore(welcome),
    count: vuexRichStore(count),
    todos: vuexRichStore(todos)
  },
  plugins: [
    store => {
      store.subscribe((mutation) => {
        console.log('[mutation] %s %s', mutation.type, JSON.stringify(mutation.payload))
      })
    }
  ]
})
